<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Banco de Compartilhamento de Conhecimento- Stefanini</title>
	<link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/static/css/theme.css" media="screen" /> 
	
		<!--	 Configuração SyntaxHighlighter -->
		<script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/static/js/selecionarTexto.js"></script>
		<script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/static/js/shCore.js"></script>
		<script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/static/js/shBrushJava.js"></script>
		<link type="text/css" href="#{facesContext.externalContext.requestContextPath}/static/css/shCoreDefault.css" rel="stylesheet"/>
	  	<script type='text/javascript'>
	  		SyntaxHighlighter.defaults['gutter']=true;
	  		SyntaxHighlighter.all();
	  	</script>
		<!--	 Configuração SyntaxHighlighter -->
</h:head>
	<h:body>
		<p:growl id="messages" autoUpdate="true" />
		<div align="center" > 
			<p:layout fullPage="false" style="min-width:1024px;max-width:800px;min-height:800px">
	
				<p:layoutUnit position="center">
					<ui:insert name="menu">
						<h:form id="formPesquisar">
							<p:menubar id="barraMenu">
								<p:menuitem value="Home" icon="ui-icon-home" url="/dinamic/pages/principal/home.jsf"/>
								<p:menuitem value="Base de Conhecimento" icon="ui-icon-comment" url="/dinamic/pages/baseDeConhecimento/baseDeConhecimento.jsf"/>
								<p:menuitem value="Novo Tópico" icon="ui-icon-pencil" action="#{postagemManagedBean.incluiPostagem()}" ajax="false"/>
								<p:menuitem value="Registre-se" icon="ui-icon-pencil" url="/dinamic/pages/manterUsuario/registro.jsf" rendered="#{empty usuarioSessaoManagedBean.dadosSessao}" update="barraMenu" />	
								<p:menuitem value="Administração" icon="ui-icon-suitcase" url="/dinamic/pages/administracao/manterAssunto/administracao.jsf" rendered="#{usuarioSessaoManagedBean.verificarAdmin()}"/>
								<p:menuitem value="Consulta Banco" icon="ui-icon-search" url="/dinamic/pages/principal/teste.jsf" />
								<f:facet name="options">
									<p:inputText style="margin-right:10px" value="#{pesquisaManagedBean.pesquisaDigitada}"/>
									<p:commandButton ajax="false" value="Pesquisar" action="#{pesquisaManagedBean.pesquisar()}" />
		  						</f:facet>
							</p:menubar>
						</h:form>
						<h:form id="formLogin">
							<div align="right">
								<p:panel styleClass="semEspaco" rendered="#{empty usuarioSessaoManagedBean.dadosSessao.nome}">
									<p:outputLabel style="font-size:12px" value="Email: " />
									<p:inputText size="15" id="email"  value="#{usuarioManagedBean.usuario.email}" requiredMessage="Informe o E-mail !"/> 
			           				<p:outputLabel style="font-size:12px" value="Senha: " />
			           				<p:password size="15" id="senha" value="#{usuarioManagedBean.usuario.senha}" requiredMessage="Informe a senha !"/>  
			            			<p:commandButton value="Login" action="#{usuarioManagedBean.logar()}" ajax="false" icon="ui-icon-check" />
								</p:panel>
							</div>				
								
							<p:menubar styleClass="semEspaço" rendered="#{not empty usuarioSessaoManagedBean.dadosSessao.nome}">
								<p:menuitem title="Exibir Meus Dados" styleClass="name" value="Meus dados"  icon="ui-icon-document" url="/dinamic/pages/manterUsuario/mostrarMeusDados.jsf" />
								<p:menuitem title="Minhas Mensagens" styleClass="name" value="Mensagens"  icon="ui-icon-mail-closed" url="/dinamic/pages/manterUsuario/mostrarMinhasMensagens.jsf"/>
								<f:facet name="options" >
									<p:outputLabel style="font-weight: bold" styleClass="line.highlighted.alt1" value="Bem Vindo, #{usuarioSessaoManagedBean.dadosSessao.nome} "/>
									<p:commandButton title="Sair" value="Logout" action="#{usuarioManagedBean.deslogar()}" ajax="false" icon="ui-icon-close" />
								</f:facet>					
							</p:menubar>
						</h:form>
					</ui:insert>
					
					<ui:insert name="conteudo"/>
		                      
				</p:layoutUnit>
			</p:layout>
		</div>
</h:body>
</html>